package com.imooc.ecommerce.vo;

import io.jsonwebtoken.Jwts;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * <p>通用响应对象定义
 * <pre>
 *  {
 *     "code": 0,
 *     "message": "",
 *     "data": {}
 * }
 * </pre>
 *
 * @author Yaxi.Zhang
 * @since 2022/10/30 17:12
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CommonResponse<T> implements Serializable {
    /**
     * 错误码
     */
    private Integer code;

    /**
     * 错误消息
     */
    private String message;

    /**
     * 泛型响应数据
     */
    private T Data;

    public CommonResponse(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

}
